<template>
	<view>
		<swiper-banner height="100" :data="resData" @click="swiperClick"></swiper-banner>
	</view>
</template>

<script>
    import swiperBanner from '@/components/wlp-swiper-banner/wlp-swiper-banner.vue';
    
	export default {
        components: {
            swiperBanner
        },
		data() {
			return {
				data: [
                    {
                    	imgUrl: '/static/img/loading.png',
                    	link: '加载中...'
                    },
                    {
                    	imgUrl: '/static/temp/swiper (1).jpg',
                    	link: 'www.baidu.com'
                    },
                    {
                    	imgUrl: '/static/temp/swiper (2).jpg',
                    	link: 'www.taobao.com'
                    },
                    {
                    	imgUrl: '/static/temp/swiper (3).jpg',
                    	link: 'www.youdao.com'
                    }
                ]
			};
		},
        computed: {
            resData: function(){
                let obj = [];
                for(let item of this.data){
                    obj.push(item.imgUrl);
                }
                return obj;
            }
        },
        methods: {
            swiperClick: function(index){
                console.log(this.data[index].link);
            }
        }
	}
</script>

<style>

</style>
